<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>datalist元素</title>
</head>
<body>
<form action="#" method="post">
  请输入用户名：<input type="text" list="namelist"/>
  <datalist id="namelist">
    <option>admin</option>
    <option>lucy</option>
    <option>lily</option>
  </datalist>
  <input type="submit" value="提交">
</from>
</body>
</html>